/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.sql.Timestamp;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

/**
 *
 * @author tony
 */
@Entity
public class InvoiceDetails implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long invoiceId;
    private String merchantUserName;  
    private Timestamp invoiceDate;
    private String merchantBillingAddress;   //stakeholder acct
    private String merchantManagerName;   //stakeholder acct
    private String merchantContactNumber;  //stakeholder acct
/*    private String itemName;  //transaction
    private String itemDescription; //transaction
    private int itemQuantity;  //may not need
    private double itemUnitPrice;  //transaction
    private int itemDiscount;  //transaction
    private double itemAmount;  //transaction */
    private double totalDiscount;  
    private double totalAmount;
    
    @ManyToOne(targetEntity=Transactions.class,cascade=(CascadeType.ALL),fetch=FetchType.EAGER)
    private Transactions transactions;
    
    public Long getId() {
        return invoiceId;
    }

    public void setId(Long invoiceId) {
        this.invoiceId = invoiceId;
    }
    
    public String getMerchantUserName() {
        return merchantUserName;
    }
    
    public void setMerchantUserId(String merchantUserName) {
        this.merchantUserName = merchantUserName;
    }
    
    public Timestamp getInvoiceDate() {
        return invoiceDate;
    }
    
    public void setInvoiceDate(Timestamp invoiceDate){
        this.invoiceDate = invoiceDate;
    }
    
    public String getMerchantBillingAddress() {
        return merchantBillingAddress;
    }
    
    public void setMerchantBillingAddress(String merchantBillingAddress) {
        this.merchantBillingAddress = merchantBillingAddress;
    }
    
    public String getMerchantManagerName() {
        return merchantManagerName;
    }
    
    public void setMerchantManagerName(String merchantManagerName){
        this.merchantManagerName = merchantManagerName;
    }
    
    public String getMerchantContactNumber(){
        return merchantContactNumber;
    }
    
    public void setMerchantContactNumber(String merchantContactNumber) {
        this.merchantContactNumber = merchantContactNumber;
    }
    
  /*  public String getItemName() {
        return itemName;
    }
    
    public void setItemName(String itemName) {
        this.itemName = itemName;
    }
    
    public String getItemDescription() {
        return itemDescription;
    }
    
    public void setItemDescription(String itemDescription) {
        this.itemDescription = itemDescription;
    }
    
    public int getItemQuantity() {
        return itemQuantity;
    }
    
    public void setItemQuantity(int itemQuantity) {
        this.itemQuantity = itemQuantity;
    }
    
    public double getItemUnitPrice() {
        return itemUnitPrice;
    }
    
    public void setItemUnitPrice(double itemUnitPrice) {
        this.itemUnitPrice = itemUnitPrice;
    }
    
    public int getItemDiscount() {
        return itemDiscount;
    }
    
    public void setItemDiscount(int itemDiscount) {
        this.itemDiscount = itemDiscount;
    }
    
    public double getItemAmount() {
        return itemAmount;
    }
    
    public void setItemAmount(double itemAmount) {
        this.itemAmount = itemAmount;
    }
    */
    
    public double getTotalDiscount() {
        return totalDiscount;
    }
    
    public void setTotalDiscount(double totalDiscount){
        this.totalDiscount = totalDiscount;
    }
    
    public double getTotalAmount() {
        return totalAmount;
    }
    
    public void setTotalAmount(double totalAmount){
        this.totalAmount = totalAmount;
    }
    
    public Transactions getTransactions() {
        return transactions;
    }
    
    public void setTransactions(Transactions transactions){
        this.transactions = transactions;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (invoiceId != null ? invoiceId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the invoiceId fields are not set
        if (!(object instanceof InvoiceDetails)) {
            return false;
        }
        InvoiceDetails other = (InvoiceDetails) object;
        if ((this.invoiceId == null && other.invoiceId != null) || (this.invoiceId != null && !this.invoiceId.equals(other.invoiceId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.TransactionDetails[ invoiceId=" + invoiceId + " ]";
    }
    
}
